home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Offline Browsing / HTTrack.exe / data1.cab / Sources / src / htsglobal.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-04-28  |  6.3 KB  |  265 lines

  1. /* ------------------------------------------------------------ */
  2. /*
  3. HTTrack Website Copier, Offline Browser for Windows and Unix
  4. Copyright (C) Xavier Roche and other contributors
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  
  20.  
  21. Important notes:
  22.  
  23. - We hereby ask people using this source NOT to use it in purpose of grabbing
  24. emails addresses, or collecting any other private information on persons.
  25. This would disgrace our work, and spoil the many hours we spent on it.
  26.  
  27.  
  28. Please visit our Website: http://www.httrack.com
  29. */
  30.  
  31.  
  32. /* ------------------------------------------------------------ */
  33. /* File: Global #define file                                    */
  34. /* Author: Xavier Roche                                         */
  35. /* ------------------------------------------------------------ */
  36.  
  37. // Fichier rΘunissant l'ensemble des defines
  38.  
  39. #ifndef HTTRACK_GLOBAL_DEFH
  40. #define HTTRACK_GLOBAL_DEFH
  41.  
  42. // Version
  43. #define HTTRACK_VERSION      "3.01"
  44. #define HTTRACK_VERSIONID    "3.01.00"
  45. #define HTTRACK_AFF_VERSION  "3.x"
  46. //#define HTTRACK_AFF_WARNING  "This is a RELEASE CANDIDATE version of WinHTTrack Website Copier 3.0\nPlease report us any bug or problem"
  47.  
  48.  
  49.  
  50. // DΘfinition plate-forme
  51. #include "htssystem.h"
  52. #include "htsconfig.h"
  53.  
  54. // Socket windows ou socket unix
  55. #if HTS_PLATFORM==1
  56. #define HTS_WIN 1
  57. #else
  58. #define HTS_WIN 0
  59. #endif
  60.  
  61. // compatibilitΘ DOS
  62. #if HTS_WIN
  63. #define HTS_DOSNAME 1
  64. #else
  65. #define HTS_DOSNAME 0
  66. #endif
  67.  
  68. /*
  69. #if HTS_XGETHOST
  70. #if HTS_PLATFORM==1
  71. #ifndef __cplusplus
  72. #undef HTS_XGMETHOD
  73. #undef HTS_XGETHOST
  74. #endif
  75. #endif
  76. #else
  77. #undef HTS_XGMETHOD
  78. #undef HTS_XGETHOST
  79. #endif
  80. */
  81.  
  82. /* rc file */
  83. #if HTS_WIN
  84. #define HTS_HTTRACKRC "httrackrc"
  85. #else
  86. #define HTS_HTTRACKRC ".httrackrc"
  87. #define HTS_HTTRACKCNF "/etc/httrack.conf"
  88. #endif
  89.  
  90. /* Gestion des tables de hashage */
  91. #define HTS_HASH_SIZE 20147
  92. /* Taille max d'une URL */
  93. #define HTS_URLMAXSIZE 512
  94. /* Taille max ligne de commande (>=HTS_URLMAXSIZE*2) */
  95. #define HTS_CDLMAXSIZE 1024
  96. /* Copyright (C) Xavier Roche and other contributors */
  97. #define HTTRACK_AFF_AUTHORS "[XR,YP'2001]"
  98. #define HTS_DEFAULT_FOOTER "<!-- Mirrored from %s by HTTrack Website Copier/"HTTRACK_AFF_VERSION" "HTTRACK_AFF_AUTHORS" -->"
  99. #define HTS_UPDATE_WEBSITE "http://www.httrack.com/update.php3?Product=HTTrack&Version="HTTRACK_VERSIONID"&VersionStr="HTTRACK_VERSION"&Platform=%d&Language=%s"
  100. //#define HTS_UPDATE_WEBSITE "http://ghost/update.php3?Product=HTTrack&Version="HTTRACK_VERSIONID"&Platform=%d"
  101.  
  102. #define H_CRLF "\x0d\x0a"
  103. #define CRLF   "\x0d\x0a"
  104. #if HTS_WIN
  105. #define LF "\x0d\x0a"
  106. #else
  107. #define LF "\x0a"
  108. #endif
  109.  
  110. /* Θquivaut α "paramΦtre vide", par exemple -F (none) */
  111. #define HTS_NOPARAM "(none)"
  112. #define HTS_NOPARAM2 "\"(none)\""
  113.  
  114. /* maximum et minimum */
  115. #define maximum(A,B) ( (A) > (B) ? (A) : (B) )
  116. #define minimum(A,B) ( (A) < (B) ? (A) : (B) )
  117.  
  118. /* chaine vide? */
  119. #define strnotempty(A) (((A)[0]!='\0') ? 1 : 0)
  120.  
  121. /* optimisation inline si possible */
  122. #ifdef __cplusplus
  123. #define HTS_INLINE inline
  124. #else
  125. #define HTS_INLINE
  126. #endif
  127.  
  128. #ifdef HTS_NO_64_BIT
  129. #define HTS_LONGLONG 0
  130. #else
  131. #define HTS_LONGLONG 1
  132. #endif
  133.  
  134. // long long int? (or int)
  135. // (and int cast for system functions like malloc() )
  136. #if HTS_LONGLONG
  137.  #if HTS_WIN
  138.   typedef __int64 LLint;
  139.   typedef int INTsys;
  140.   #define LLintP "%I64d"
  141.  #else
  142.   typedef long long int LLint;
  143.   typedef int INTsys;
  144.   #define LLintP "%Ld"
  145.  #endif
  146. #else
  147.  typedef int LLint;
  148.  typedef int INTsys;
  149.  #define LLintP "%d"
  150. #endif
  151.  
  152. #if HTS_WIN
  153. #else
  154. #define __cdecl 
  155. #endif
  156.  
  157. /* mode pour mkdir ET chmod (accΦs aux fichiers) */
  158. #define HTS_PROTECT_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR)
  159. #if HTS_ACCESS
  160. #define HTS_ACCESS_FILE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
  161. #define HTS_ACCESS_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
  162. #else
  163. #define HTS_ACCESS_FILE (S_IRUSR|S_IWUSR)
  164. #define HTS_ACCESS_FOLDER (S_IRUSR|S_IWUSR|S_IXUSR)
  165. #endif
  166.  
  167. /* vΘrifier la dΘclaration des variables prΘprocesseur */
  168. #ifndef HTS_DOSNAME
  169. #error | HTS_DOSNAME Has not been defined.
  170. #error | Set it to 1 if you are under DOS, 0 under Unix.
  171. #error | Example: place this line in you source, before includes:
  172. #error | #define HTS_DOSNAME 0
  173. #error
  174. #error
  175. #endif
  176. #ifndef HTS_ACCESS
  177. /* Par dΘfaut, accΦs α tous les utilisateurs */
  178. #define HTS_ACCESS 1
  179. #endif
  180.  
  181. /* fflush sur stdout */
  182. #define io_flush { fflush(stdout); fflush(stdin); }
  183.  
  184.  
  185.  
  186. /* HTSLib */
  187.  
  188. // Cache DNS, accΘlΦre les rΘsolution d'adresses
  189. #define HTS_DNSCACHE 1
  190.  
  191. // ID d'une pseudo-socket locale pour les file://
  192. #define LOCAL_SOCKET_ID -500000
  193.  
  194. // taille de chaque buffer (10 sockets 650 ko)
  195. #define TAILLE_BUFFER 65535
  196.  
  197. #if HTS_WIN
  198. #else
  199. // use pthreads.h
  200. #ifdef HTS_DO_NOT_USE_PTHREAD
  201. #define USE_PTHREAD 0
  202. #else
  203. #define USE_PTHREAD 1
  204. #endif
  205. #endif
  206.  
  207. #if HTS_WIN
  208. #define USE_BEGINTHREAD 1
  209. #else
  210. #if USE_PTHREAD
  211. #define USE_BEGINTHREAD 1
  212. #else
  213. /* sh*t.. */
  214. #define USE_BEGINTHREAD 0
  215. #endif
  216. #endif
  217.  
  218. /* ------------------------------------------------------------ */
  219. /* Debugging                                                    */
  220. /* ------------------------------------------------------------ */
  221.  
  222. // dΘbuggage types
  223. #define DEBUG_SHOWTYPES 0
  224. // backing debug
  225. #define BDEBUG 0
  226. // chunk receive
  227. #define CHUNKDEBUG 0
  228. // realloc links debug
  229. #define MDEBUG 0
  230. // cache debug
  231. #define DEBUGCA 0
  232. // DNS debug
  233. #define DEBUGDNS 0
  234. // savename debug
  235. #define DEBUG_SAVENAME 0
  236. // debug robots
  237. #define DEBUG_ROBOTS 0
  238. // debug hash
  239. #define DEBUG_HASH 0
  240. // VΘrification d'intΘgritΘ
  241. #define DEBUG_CHECKINT 0
  242. // nbr sockets debug
  243. #define NSDEBUG 0
  244. // tracer mallocs
  245. #define HTS_TRACE_MALLOC 0
  246.  
  247. // dΘbuggage HTSLib
  248. #define HDEBUG 0
  249. // surveillance de la connexion
  250. #define CNXDEBUG 0
  251. // debuggage cookies
  252. #define DEBUG_COOK 0
  253. // dΘbuggage hard..
  254. #define HTS_WIDE_DEBUG 0
  255. // debuggage deletehttp et cie
  256. #define HTS_DEBUG_CLOSESOCK 0
  257. // debug tracage mΘmoire
  258. #define MEMDEBUG 0
  259.  
  260. // htsmain
  261. #define DEBUG_STEPS 0
  262.  
  263. #endif
  264.  
  265.